// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLAlterTableRenameConstraint.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"

SQLAlterTableRenameConstraint::SQLAlterTableRenameConstraint()
{
}

// @Override
void SQLAlterTableRenameConstraint::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableRenameConstraint)))
  {
    acceptChild(visitor, constraint);
    acceptChild(visitor, to);
  }
  visitor->endVisit(SharedObject(SQLAlterTableRenameConstraint));
}
SQLName_ptr SQLAlterTableRenameConstraint::getConstraint()
{
  return constraint;
}

void SQLAlterTableRenameConstraint::setConstraint(SQLName_ptr constraint)
{
  if (constraint != nullptr)
  {
    constraint->setParent(SharedObject(SQLAlterTableRenameConstraint));
  }
  this->constraint = constraint;
}

SQLName_ptr SQLAlterTableRenameConstraint::getTo()
{
  return to;
}

void SQLAlterTableRenameConstraint::setTo(SQLName_ptr to)
{
  if (to != nullptr)
  {
    to->setParent(SharedObject(SQLAlterTableRenameConstraint));
  }
  this->to = to;
}
